home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0046_VGA ClrScr #2.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  2KB  |  61 lines

  1. {   The following Turbo Pascal Program displays HARDWARE SCROLLinG
  2.    For 100% Compatible VGA cards,in mode $13.
  3.    I'd be grateful if anyone interested
  4.    could test this and report the results :
  5. }
  6.  
  7. Program VGASLIDE; {requirements TP6 or higher + register-Compatible VGA
  8. }
  9.  
  10. Uses Crt;
  11.  
  12. Var
  13.   t,slide:Word;
  14.   ch:Char;
  15.  
  16. Procedure VgaBase(Xscroll,Yscroll:Integer);
  17.   Var dum:Byte;
  18.  begin
  19.   Dec(SLIDE,(Xscroll+320*Yscroll));   { slide scrolling state         }
  20.   Port[$03d4]:=13;                    { LO register of VGAMEM offset  }
  21.   Port[$03d5]:=(SLIDE shr 2) and $FF; { use 8 bits:  [9..2]           }
  22.   Port[$03d4]:=12;                    { HI register of VGAMEM offset  }
  23.   Port[$03d5]:= SLIDE shr 10;         { use 6 bits   [16..10]         }
  24.   Dum:=Port[$03DA];                   { reset to input by dummy read  }
  25.   Port[$03C0]:=$20 or $13;            { smooth pan = register $13     }
  26.   Port[$03C0]:=(SLIDE and 3) Shl 1;   { use bits [1..0], make it 0-2-4-6
  27. }
  28.  end;
  29.  
  30.  
  31. begin {main}
  32.  
  33.   Asm                {inITIALIZE vga mode $13 using BIOS}
  34.   MOV AX,00013h
  35.   inT 010h
  36.   end;
  37.  
  38.   SLIDE:=0;
  39.  
  40.   { draw a quick test pattern directly to video memory }
  41.   For T:= 0 to 63999 do MEM[$A000:T]:=(T mod (317 + T div 10000)) and 255;
  42.  
  43.   Repeat
  44.    Vgabase(-1,-1);  { scroll smoothly in UPPER LEFT direction }
  45.    Delay(14);
  46.   Until KeyPressed;
  47.   ch:=ReadKey;
  48.  
  49.   Repeat
  50.    Vgabase( 1, 1);  { scroll smoothly in LOWER RIGHT direction }
  51.    Delay(14);
  52.   Until KeyPressed;
  53.   ch:=ReadKey;
  54.  
  55.   Asm
  56.   MOV AX,00003h   {reset to Textmode}
  57.   inT 010h
  58.   end;
  59.  
  60. end.
  61.